using AdmissionQA.Application.Common;
using AdmissionQA.Application.Dtos.TuitionFee;
using AdmissionQA.Domain.Entities;

namespace AdmissionQA.Application.ServiceInterfaces;

/// <summary>
/// 学费信息服务接口
/// </summary>
public interface ITuitionFeeServices
{
    /// <summary>
    /// 创建学费信息
    /// </summary>
    /// <param name="tuitionFee">学费信息</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateTuitionFeeAsync(TuitionFeeDto tuitionFee);

    /// <summary>
    /// 批量创建学费信息
    /// </summary>
    /// <param name="tuitionFees">学费信息列表</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateTuitionFeesAsync(TuitionFeesDto tuitionFees);

    /// <summary>
    /// 根据ID获取学费信息
    /// </summary>
    /// <param name="id">学费信息ID</param>
    /// <returns>学费信息</returns>
    Task<Result<TuitionFeeWithMajorNameDto>> GetTuitionFeeByIdAsync(Guid id);

    /// <summary>
    /// 获取所有学费信息
    /// </summary>
    /// <returns>学费信息列表</returns>
    Task<Result<IEnumerable<TuitionFeeWithMajorNameDto>>> GetAllTuitionFeesAsync();

    /// <summary>
    /// 分页获取学费信息
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页大小</param>
    /// <returns>分页结果</returns>
    Task<Result<IEnumerable<TuitionFeeWithMajorNameDto>>> GetPagedTuitionFeesAsync(
        int pageIndex = 0,
        int pageSize = 10
    );

    /// <summary>
    /// 根据专业ID获取学费信息
    /// </summary>
    /// <param name="majorId">专业ID</param>
    /// <returns>匹配的学费信息列表</returns>
    Task<Result<IEnumerable<TuitionFeeWithMajorNameDto>>> GetTuitionFeesByMajorIdAsync(
        Guid majorId
    );

    /// <summary>
    /// 更新学费信息
    /// </summary>
    /// <param name="id">学费信息ID</param>
    /// <param name="tuitionFee">学费信息</param>
    /// <returns>更新结果</returns>
    Task<Result<string>> UpdateTuitionFeeAsync(Guid id, TuitionFeeDto tuitionFee);

    /// <summary>
    /// 删除学费信息
    /// </summary>
    /// <param name="id">学费信息ID</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteTuitionFeeAsync(Guid id);

    /// <summary>
    /// 批量删除学费信息
    /// </summary>
    /// <param name="ids">学费信息ID列表</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteTuitionFeesAsync(IEnumerable<Guid> ids);

    /// <summary>
    /// 获取学费信息总数
    /// </summary>
    /// <returns>学费信息总数</returns>
    Task<int> GetTuitionFeeCountAsync();

    /// <summary>
    /// 基于向量相似度搜索学费信息
    /// </summary>
    /// <param name="text">查询文本</param>
    /// <param name="topK">返回最相似的前K个</param>
    /// <returns>最相似的学费信息列表</returns>
    Task<Result<IEnumerable<TuitionFee>>> SearchTuitionFeesByEmbeddingAsync(string text, int topK = 5);
}
